package uk.ac.cam.cl.projectcharlie2010.hardwaremove;

import gnu.io.CommPortIdentifier;

import java.util.ArrayList;
import java.util.Enumeration;
 
public class PortLister {

	public static String[] getPortStringArray() {
		Enumeration<CommPortIdentifier> ports = CommPortIdentifier.getPortIdentifiers();
		
		ArrayList<String> portList = new ArrayList<String>();
		
		while(ports.hasMoreElements()) {
			portList.add(ports.nextElement().getName());
		}
		
		return portList.toArray(new String[0]);
	}
}